<?php session_start(); $_SESSION['page'] = 'news';?>
<?php
    $userType = $_COOKIE['userType'];
    $libraryNo = $_COOKIE['libraryNo'];
?>
<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>News</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000" class=''>

    <table width='80%' align='center' class='content'>
        <tr><td colspan='2'><img src='images/banner.jpg'></td></tr>
        <tr><td align='right' colspan='2' class='logout'><?php require('loginout.php');?></td></tr>
        <tr class='menuborder'><td width='90%'><img src='images/newsedit.png'></td><td><?php require('buttons.php');?></td></tr>
        <tr><td colspan='2' class='bodyborder'>
        <form method='POST' action='update.php?page=news&newsID=$newsID'>
            <table align='center'>
            <?php
                require('db_connection.php');
                $libraryNo = $_COOKIE['libraryNo'];
                $newsID = $_GET['newsID'];
                $query = "SELECT * FROM tblnews WHERE newsID='$newsID'";
                $result = mysql_query($query);
                while ($row = mysql_fetch_array($result))
                {
                      $newsID=$row['newsID'];
                      $title=$row['title'];
                      $author=$row['author'];
                      $content=$row['content'];
                }
                
                echo "<tr><td height='30'></td></tr>
                <input type='hidden' value='$newsID' name='newsID'>
                <input type='hidden' value='$libraryNo' name='libraryNo'>
                <tr><td>Title</td><td><input type='text' size='30' name='title' value='$title'></td></tr>
                <tr><td>Author</td><td><input type='text' size='30' name='author' value='$author' disabled='disabled'></td></tr>
                <tr><td>Content</td></tr>
                <tr><td colspan='2'><textarea rows='10' cols='30' name='content' value='$content'>$content</textarea></td></tr>
                <tr><td colspan='2' align='right'><input type='submit' value='Update' class='tool'></td></tr>
                <tr><td height='30'></td></tr>";
            ?>
            </table>
        </td></tr>
        <tr><td align='center' colspan='2'><?php require ('copyright.php')?></td></tr>
    </table>

   </body>
</html>
